﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;
using System.Configuration;

namespace KasaTakip
{
    static class Program
    {
        public static DevExpress.LookAndFeel.DefaultLookAndFeel look = new DevExpress.LookAndFeel.DefaultLookAndFeel();
        public static Database Db;
        public static bool AdminMode = false;
        public static int AktifDepoNo = Cevir.Parse<int>(ConfigurationManager.AppSettings["MagazaNo"]);


        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            bool calisiyor;
            Mutex Mtx = new Mutex(true, "KasaTakip", out calisiyor);
            if (!calisiyor)
            {
                MessageBox.Show("Program çalışıyor.");
                return;
            }
            look.LookAndFeel.SkinName = "Blue";
            DevExpress.Skins.SkinManager.EnableFormSkins();

            Printing.CreateReportTemplates();

            Db = Functions.VtYukle(Application.StartupPath);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmMain());

            Functions.SaveDb(Application.StartupPath, Db);
        }
    }
}
